<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        h2 {
            text-align: center;
        }

        table {
            border-collapse: collapse;
            height: 80px;
            margin: 0 auto;
            text-align: center;
        }

        table,
        th,
        td {
            border: 1px solid black;
        }

        th {
            padding: 5px 30px;
        }
    </style>
</head>

<body>
    <table>
        <tr>
            <th>id</th>
            <th>名称</th>
            <th>年龄</th>
            <th>性别</th>
            <th>外号</th>
        </tr>

        <script>
            let arr = [{ id: 1, names: '李星云', age: 20, gender: '男', jm: '天子/第二代不良帅' },
            { id: 2, names: '侯卿', age: 60, gender: '男', jm: '四大尸祖' },
            { id: 3, names: '袁天罡', age: 320, gender: '男', jm: '第一代不良帅' },
            { id: 4, names: '张子凡', age: 20, gender: '男', jm: '张天师' },
            { id: 5, names: '姬如雪', age: 20, gender: '女', jm: '小雪' },
            { id: 6, names: '上官云雀', age: 20, gender: '不详', jm: '天巧星' }
            ]
            for (let i = 0; i < arr.length - 1; i++) {
                document.write(`
                    <tr>
                    <td>${i + 1}</td>
                    <td>${arr[i].names}</td>
                    <td>${arr[i].age}</td>
                    <td>${arr[i].gender}</td>
                    <td>${arr[i].jm}</td>
                    </tr>
                `)
            }

        </script>
    </table>
</body>

</html>